<?php
App::uses('AppModel', 'Model');
App::import('Model', 'User');
App::import('Model', 'Variant');
App::import('Model', 'Post');
App::import('Model', 'Product');
App::import('Model', 'Category');
/**
 * Parameter Model
 *
 */
class Parameter extends AppModel {
	public function getUserStatus(){
		$types = $this->find('list',
										array('fields'				=> array('value', 'description'),
										      'conditions' 		=> array('type' => 0, 'object' => 'User')
													));
		return $types;
	}

	public function getPropertyConstraint(){
		$constraints = $this->find('all',
										array('fields'				=> array('value', 'description'),
										      'conditions' 		=> array('type' => 0, 'object' => 'Property')
													));
		return $constraints;
	}

/**
 * getProductStatus
 *
 */
	public function getProductStatus(){
		$product = new Product();
		$status = $this->find('list',
										array('fields'				=> array('value', 'description'),
										      'conditions' 		=> array('type' => 0, 'object' => $product->name)
													));
		return $status;
	}

/**
 * getVariantImageSizes
 *
 */
	public function getVariantImageSizes(){
		$variant = new Variant();
		$sizes = $this->find('all',
										array('fields'				=> array('value', 'description', 'code'),
										      'conditions' 		=> array('type' => Variant::typeImage, 'object' => $variant->name)
													));
		return $sizes;
	}

/**
 * getPostImageSizes
 *
 */
	public function getPostImageSizes(){
		$post = new Post();
		$sizes = $this->find('all',
										array('fields'				=> array('value', 'description', 'code'),
										      'conditions' 		=> array('type' => Post::typeImage, 'object' => $post->name)
													));
		return $sizes;
	}

/**
 * getCategoryTypes
 *
 */
	public function getCategoryTypes(){
		$types = $this->find('list',
										array('fields'				=> array('value', 'description'),
										      'conditions' 		=> array('type' => Category::type, 'object' => 'Category')
													));
		return $types;
	}

/**
 * getCategoryStatus
 * 
 */
	public function getCategoryStatus(){
		$status = $this->find('list',
										array('fields'				=> array('value', 'description'),
										      'conditions' 		=> array('type' => Category::status, 'object' => 'Category')
													));
		return $status;
	}
}
